package com.sugar.follow.up.module.business.dal.mysql.patientfszl;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.controller.admin.patient.fszl.vo.PatientFszlPageReqVO;
import com.sugar.follow.up.module.business.dal.dataobject.patientfszl.PatientFszlDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 放射治疗 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface PatientFszlMapper extends BaseMapperX<PatientFszlDO> {

    default PageResult<PatientFszlDO> selectPage(PatientFszlPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PatientFszlDO>()
                .eqIfPresent(PatientFszlDO::getPatientId, reqVO.getPatientId())
                .likeIfPresent(PatientFszlDO::getPatientName, reqVO.getPatientName())
                .eqIfPresent(PatientFszlDO::getDoctorId, reqVO.getDoctorId())
                .likeIfPresent(PatientFszlDO::getDoctorName, reqVO.getDoctorName())
                .betweenIfPresent(PatientFszlDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PatientFszlDO::getId));
    }

}